home *** CD-ROM | disk | FTP | other *** search
/ Merciful 2 / Merciful - Disc 2.iso / software / h / hdinstallersiii.dms / hdinstallersiii.adf / Skidmarks2 / HD_Install next >
Text File  |  1995-04-06  |  7KB  |  313 lines

  1. ;
  2. ;    SUPER SKiD MARKS (SKiD MARKS 2) TRACK-DISKS HD INSTALLER
  3. ;                Done by -Mok-
  4. ;      Greetz to all Prestige members! Now, when you are here
  5. ;                      what are ya gonna do? :-)
  6. ;
  7. ;check if run from hd...
  8.     set q filelen("C:Delete")
  9.     if q 0 _bahWB
  10.     set q filelen("C:Copy")
  11.     ifnot q 0 _gotWB
  12. _bahWB
  13.     ASK "You must run the install program booted from your HardDrive!" " WILL DO IT " 0 0
  14.     ABORT
  15. _gotWB
  16. ;alloc memory for da preview file buffer
  17.     ALLOC 0 50AA 10001
  18.     set prev mem(0)
  19. ;alloc memory for directory
  20.     ALLOC 1 400 10001
  21.     set dirmem mem(1)
  22. ;check if you want to install the whole game or not
  23. ;get source drive
  24.     GETDRIVE
  25.     ASK "Do you want to install the whole game or just the Track Disks 1-4?" "THE WHOLE GAME|TRACK DISKS" 0 0
  26.     ifnot answer 1 _justtracks
  27.     ECHO " Select the subdirectory where I should create 'SM2' dir." 0 0
  28.     PAUSE 50
  29.     ASKDIR
  30.     AT 1 6
  31.     clw    
  32.     ECHO "SKiDMARKS 2 by ACiD SOFTWARE, Cracked by (*) PRESTiGE (*)" 0 0
  33.     ECHO " HD Installer by Mok :-)" 0 0
  34. ;delete existing directory with all the contents
  35.     EXE "c:Delete >NIL: %sSM2/#? ALL" fullpath 0
  36.     EXE "c:Delete >NIL: %sSM2" fullpath 0
  37. ;check for free space
  38.     FREESPACE Q
  39.     IFBIG Q !5000000 _enuff1
  40.     ASK "You need at least 5 MB of free space to install the game" " _I'LL FIX IT! " 0 0
  41.     ABORT
  42. _enuff1
  43. ;create track directory
  44.     MDIR SM2
  45.     DIRICON SM2.info
  46.     CD SM2
  47.     MDIR Gfx
  48.     MDIR Sfx
  49.     MDIR Vehicles
  50.     DOWNLINE
  51.     ECHO " Installing Boot Disk..." 0 0
  52.     UPLINE
  53. _getdisk1
  54.     set q filelen("SKID2:SkidMarks2")
  55.     IF q 0 _getdisk1
  56.     EXE "C:Copy >NIL: SKID2:#? %s" fullpath 0
  57.     EXE "C:Copy >NIL: SKID2:GFX %sGfx" fullpath 0
  58.     EXE "C:Copy >NIL: SKID2:SFX %sSfx" fullpath 0
  59.     EXE "C:Copy >NIL: SKID2:VEHICLES %sVehicles" fullpath 0
  60. ;delete not needed mainfile for 1 meg machines
  61.     DEL Skid1Meg
  62.     ECHO " Installing Boot Disk... Done." 0 0
  63.     DOWNLINE
  64. ;ask which car disks to install
  65. ;set type to aga as default
  66.     set type 0
  67.     ASK "Do you want to install AGA or ECS cars?" " AGA | ECS " 0 0
  68.     if answer 1 _agacars
  69.     set type 1
  70.     go _nodelmini
  71. _agacars
  72.     EXE "C:Delete >NIL: %sVehicles/Mini.ecs" fullpath 0
  73. _nodelmini
  74.     CD Vehicles
  75.     INHIBIT
  76. ;ask for disk 1 and read dir
  77.     set disk 1
  78.     set dn 3
  79.     if type 0 _cdisk1
  80.     set disk 3
  81.     set dn 4
  82. _cdisk1
  83.     ASK "Please insert SKID MARKS II CAR DISK %ld and press RETURN" " _DONE | _ABORT " disk 0
  84.     ifnot answer 1 _abort
  85.     rs dirmem 0 400
  86.     ifnot peekl(dirmem) 'car0'+dn _cdisk1
  87.     ECHO " Found Car Disk %ld." disk 0
  88.     DOWNLINE
  89.     r a5 dirmem+c
  90.     set name 'ECS '&FFFFFF00
  91.     if type 1 _ecsloop
  92.     set name 'AGA '&FFFFFF00
  93. _agaloop
  94.     if peek(\a5) 0 _agadone
  95.     r d0 peekl(\a5)&DFDFDF00
  96.     if \d0 name _gotagafile
  97. _aganext
  98.     FREE 2
  99.     r a5 \a5+28
  100.     go _agaloop
  101. _gotagafile
  102.     set n peek(\a5+3)-'0'
  103.     set st peekl(\a5+24)
  104.     set le peekl(\a5+20)
  105.     ALLOC 2 le 10001
  106.     rs mem(2) st le
  107.     ifnot n 0 _notaga0
  108.     ] mem(2) le MINI.AGA
  109.     go _aganext
  110. _notaga0
  111.     ifnot n 1 _notaga1
  112.     ] mem(2) le PORSCHE.AGA
  113.     go _aganext
  114. _notaga1
  115.     ifnot n 2 _notaga2
  116.     ] mem(2) le VW.AGA
  117.     go _aganext
  118. _notaga2
  119.     ifnot n 3 _notaga3
  120.     ] mem(2) le CAMARO.AGA
  121.     go _aganext
  122. _notaga3
  123.     ifnot n 4 _notaga4
  124.     ] mem(2) le TRUCK.AGA
  125.     go _aganext
  126. _notaga4
  127.     ifnot n 5 _notaga5
  128.     ] mem(2) le F1.AGA
  129.     go _aganext
  130. _notaga5
  131.     ifnot n 6 _notaga6
  132.     ] mem(2) le COW.AGA
  133.     go _aganext
  134. _notaga6
  135.     ifnot n 7 _notaga7
  136.     ] mem(2) le MIDGET.AGA
  137.     go _aganext
  138. _notaga7
  139.     ifnot n 8 _abort
  140.     ] mem(2) le CARAVAN.AGA
  141.     go _aganext
  142. _agadone
  143.     if disk 2 _agaalldone
  144.     set dn 2
  145.     set disk 2
  146.     go _cdisk1
  147. _agaalldone
  148.     CD /
  149.     Go _Tracks
  150. _ecsloop
  151.     if peek(\a5) 0 _ecsdone
  152.     r d0 peekl(\a5)&DFDFDF00
  153.     if \d0 name _gotecsfile
  154. _ecsnext
  155.     FREE 2
  156.     r a5 \a5+28
  157.     go _ecsloop
  158. _gotecsfile
  159.     set n peek(\a5+3)-'0'
  160.     set st peekl(\a5+24)
  161.     set le peekl(\a5+20)
  162.     ALLOC 2 le 10001
  163.     rs mem(2) st le
  164.     ifnot n 0 _notecs0
  165.     ] mem(2) le MINI.ECS
  166.     go _ecsnext
  167. _notecs0
  168.     ifnot n 1 _notecs1
  169.     ] mem(2) le PORSCHE.ECS
  170.     go _ecsnext
  171. _notecs1
  172.     ifnot n 2 _notecs2
  173.     ] mem(2) le VW.ECS
  174.     go _ecsnext
  175. _notecs2
  176.     ifnot n 3 _notecs3
  177.     ] mem(2) le CAMARO.ECS
  178.     go _ecsnext
  179. _notecs3
  180.     ifnot n 4 _notecs4
  181.     ] mem(2) le TRUCK.ECS
  182.     go _ecsnext
  183. _notecs4
  184.     ifnot n 5 _notecs5
  185.     ] mem(2) le F1.ecs
  186.     go _ecsnext
  187. _notecs5
  188.     ifnot n 6 _notecs6
  189.     ] mem(2) le COW.ecs
  190.     go _ecsnext
  191. _notecs6
  192.     ifnot n 7 _notecs7
  193.     ] mem(2) le MIDGET.ecs
  194.     go _ecsnext
  195. _notecs7
  196.     ifnot n 8 _abort
  197.     ] mem(2) le CARAVAN.ecs
  198.     go _ecsnext
  199. _ecsdone
  200.     CD /
  201.     Go _Tracks
  202. _justtracks
  203. ;ask for destination path and go there
  204. _askagain
  205.     AT 1 6
  206.     CLW
  207.     ECHO "Select the directory of the game on your HD!" 0 0
  208.     PAUSE 50
  209.     ASKDIR
  210. ;check if the game is really there
  211.     ifnot filelen("SkidMarks2") 0 _gotgame
  212.     Downline
  213.     ECHO " There's no SkidMarks2 in this directory! Try Again!" 0 0
  214.     PAUSE 50
  215.     go _askagain
  216. _gotgame
  217.     echo " Ok, the path for the game is '%s'" fullpath 0
  218.     pause 50
  219.     AT 1 6
  220.     clw    
  221.     ECHO "SKiDMARKS 2 by ACiD SOFTWARE, Cracked by (*) PRESTiGE (*)" 0 0
  222.     ECHO " TRACK DISKS HD Installer by Mok :-)" 0 0
  223.     downline
  224.     Echo " Deleting any previous installed tracks..." 0 0
  225. ;delete existing directory with all the contents
  226.     EXE "c:Delete >NIL: %sTrack/#? ALL" fullpath 0
  227.     EXE "c:Delete >NIL: %sTrack" fullpath 0
  228.     UPLINE
  229.     echo " Deleting any previous installed tracks... Done." 0 0
  230. ;check for free space
  231.     FREESPACE Q
  232.     IFBIG Q !2800000 _enuff
  233.     ASK "You need at least 2.8 MB of free space to install the tracks" " _I'LL FIX IT! " 0 0
  234. _abort
  235.     ABORT
  236. _enuff
  237. ;create track directory
  238. ;inhibit all dos access to selected drive
  239.     INHIBIT
  240. _Tracks
  241.     MDIR Track
  242.     CD Track
  243. ;ask for disk 1 and read dir
  244.     set disk 1
  245. _disk1
  246.     ASK "Please insert SKID MARKS II TRACK DISK %ld and press RETURN" " _DONE | _ABORT " disk 0
  247.     ifnot answer 1 _abort
  248.     rs dirmem 0 400
  249.     ifnot peekl(dirmem) 'trak' _disk1
  250. ;scan the directory for the header file
  251.     r a5 dirmem+C
  252. _dirloop
  253.     if peek(\a5) 0 _disk1
  254.     r d0 peekl(\a5)&DFDFDFDF
  255.     if \d0 'HEAD' _gotheader
  256.     r a5 \a5+28
  257.     go _dirloop
  258. _headererror
  259.     ASK "Error in Track Header. Installation unsuccessful :-(" "_SHIT" 0 0
  260.     ABORT
  261. _gotheader
  262.     set st peekl(\a5+24)
  263.     set le peekl(\a5+20)
  264.     ifnot le 508e _disk1
  265. ;read the track header
  266.     rs prev+1c st le
  267.     ifnot peekw(prev+501c) disk _disk1
  268.     downline
  269.     echo " Track Disk %ld found. Converting..." disk 0
  270.     pokel dirmem 'TRAC'
  271.     pokew dirmem+4 'K0'+disk
  272. ;open destination track file
  273.     OPENWAD dirmem
  274. ;write preview
  275.     WRITE prev 50AA
  276.     set offset 50AA
  277.     set map 0
  278.     r a4 prev
  279. _fileloop
  280.     set name 'MAP0'+map
  281.     r a5 dirmem+c
  282. _floop
  283.     if peek(\a5) 0 _headererror
  284.     r d0 peekl(\a5)&DFDFDFFF
  285.     if \d0 name _gotfile
  286.     r a5 \a5+28
  287.     go _floop
  288. _gotfile
  289.     set st peekl(\a5+24)
  290.     set le peekl(\a5+20)
  291.     ALLOC 2 le 10001
  292.     rs mem(2) st le
  293.     WRITE mem(2) le
  294.     FREE 2
  295.     pokel \a4 offset
  296.     r a4 \a4+4
  297.     add offset le
  298.     add map 1
  299.     ifnot map 6 _fileloop
  300.     pokel \a4 offset
  301.     SEEKW 0
  302.     WRITE prev 1C
  303.     CLOSEW
  304.     UPLINE
  305.     echo " Track Disk %ld found. Converting...Done." disk 0
  306.     add disk 1
  307.     ifnot disk 5 _disk1
  308.     downline
  309.     downline
  310.     echo " Installation successful..." 0 0
  311.     END
  312. ;boooo :) Done...
  313.